lib/repo: Fix repo-finder deleting remote configs when run
authorPhilip Withnall <withnall@endlessm.com>
Thu, 29 Jun 2017 23:43:31 +0000 (00:43 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 29 Jun 2017 23:49:25 +0000 (23:49 +0000)
An inverted condition in _ostree_repo_add_remote() was causing the
OstreeRepoFinder to delete precisely the wrong remote
configurations from memory once it was finished. It’s supposed to delete
the ones which it transiently added; but was instead deleting all the
existing remote configurations.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #985
Approved by: cgwalters

src/libostree/ostree-repo.c

index 8f3a8bd053dd944c2ac7e735a3e87f8e24ff3b00..a02214e102c5152dd2a17a685f06eded17f7cbc8 100644 (file)
@@ -181,7 +181,7 @@ _ostree_repo_add_remote (OstreeRepo   *self,
 
   g_mutex_lock (&self->remotes_lock);
 
-  already_existed = g_hash_table_replace (self->remotes, remote->name, ostree_remote_ref (remote));
+  already_existed = !g_hash_table_replace (self->remotes, remote->name, ostree_remote_ref (remote));
 
   g_mutex_unlock (&self->remotes_lock);